package com.mapper;

import com.entity.RoleEmployee;
import com.vo.InterceptorAuthorityVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author aiou
 * @since 2025-06-12
 */
@Mapper
public interface RoleEmployeeMapper{

    //删除角色员工关系表
    @Delete("delete from role_employee where role_id = #{roleId}")
    boolean deleteByRoleId(Integer roleId);

    //根据角色id查询角色员工关系表
    @Select("select * from role_employee where role_id = #{roleId}")
    List<RoleEmployee> selectByRoleId(Integer roleId);

    //保存角色员工关系表
    @Insert("insert into role_employee(role_id,employee_id) values(#{roleId},#{employeeId})")
    boolean save(RoleEmployee roleEmployee);

    //根据用户Id查询所有权限
    List<InterceptorAuthorityVO> interceptorAuthorityList(Integer employeeId);
}
